package gui.component;

import database.entity.MailBox;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

/**
 *
 * @author Tom
 */
public class MailBoxRenderer implements ListCellRenderer<MailBox>
{
    @Override
    public Component getListCellRendererComponent(JList<? extends MailBox> jlist, MailBox e, int i, boolean isSelected, boolean cellHasFocus) 
    {
        JLabel result = new JLabel(e.boxName);        
        result.setOpaque(true);
        //result.set
        if (isSelected)
        {            
            result.setBackground(Color.WHITE);
            result.setForeground(Color.RED);
            result.setFont(PreloadedFont.CALIBRI_BOLD_20);
        }
        else
        {
            result.setFont(PreloadedFont.CALIBRI_PLAIN_20);
        }
        return result;
    }   
}
